const path = require('path');
var webpack = require('webpack')
module.exports = {
    entry: {
       vendor : ['./src/lib/zepto.min', './src/modules/alike_jq'],
       app : './src/main.js'
    },
    output: {
        path: path.resolve(__dirname, 'dist'),
        publicPath: '/dist/',
        filename: '[name].bundle.js'
    },
    devServer: {
        historyApiFallback: true,
        noInfo: true
    },
    module: {
        rules: [{
            test: /\.js$/,
            exclude: /node_modules/,
            loader: 'babel-loader'
        }]
    },
    plugins: [
        new webpack.optimize.CommonsChunkPlugin({
            name: "vendor",
            // ( 公共chunk(commnons chunk) 的名称)

            minChunks: Infinity
            // minChunks: 3,
            // (模块必须被3个 入口chunk 共享)

            // chunks: ["pageA", "pageB"],
            // (只使用这些 入口chunk)
        })
    ]
}